home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1997 February
/
EnigmA AMIGA RUN 15 (1997)(G.R. Edizioni)(IT)[!][issue 1997-02][PLANET CD V].iso
/
enigma
/
earcd
/
emula
/
arosdv19.lha
/
AROS
/
scripts
/
checkmem.awk
next >
Wrap
Text File
|
1996-08-16
|
841b
|
35 lines
BEGIN { AllocMem["00000000"]=0; }
/Call AllocMem/ {
match($3,/[0-9]+/);
count=int(substr($3,RSTART,RLENGTH));
}
/Exit AllocMem=/ {
match($2,/\=/);
addr=substr($2,RSTART+1,8);
AllocMem[addr]=count;
}
/Call FreeMem/ {
match($3,/[0-9a-fA-F]+/);
addr=substr($3,RSTART,RLENGTH);
count=int($4);
if (!(addr in AllocMem) )
{
printf ("Free of %d bytes of non-allocated memory at %s\n", count, addr);
}
else if (AllocMem[addr] != count)
{
if (!AllocMem[addr])
printf ("Free of %d bytes of already freed memory at %s\n", count, addr);
else
printf ("Size mismatch at %s (AllocMem(%d), FreeMem(%d))\n", addr, AllocMem[addr], count);
}
}
END {
for (addr in AllocMem)
{
if (AllocMem[addr] != 0)
printf ("Unfreed memory of %d bytes at %s\n", AllocMem[addr], addr);
}
}